package Test;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;

import java.io.DataOutputStream;

public class clientTest {
	
	public static void main(String[]args){
		
		try {
			
			Socket s=new Socket();
			s.connect(new InetSocketAddress("127.0.0.1", 9999), 5000);
			while(true){
				OutputStream out=s.getOutputStream();
				DataOutputStream data=new DataOutputStream(out);
				String str="陈磊112233";
				byte[] pack=str.getBytes();
				data.write(pack.length-129);
				System.out.println("包长："+ ((byte)str.getBytes().length));
				data.write(pack);
				data.flush();
			}
		} catch (IOException e) {
		}
		
		
	}
}
